package com.shanpin.shebao.web.module.user.model;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

public class TUser {
	
	private int uid;
	private String user_id;
	private String phone;
	private String password;
	private String nick_name;
	private String head_img;
	private String reg_channel;
	private Date reg_time;
	private Date login_time;
	
	
	public static RowMapper<TUser> loginMapper = new RowMapper<TUser>() {

		@Override
		public TUser mapRow(ResultSet rs, int rowNum) throws SQLException {
			TUser u = new TUser();
			u.setUid(rs.getInt("u_id"));
			u.setPassword(rs.getString("password"));
			u.setHead_img(rs.getString("head_img"));
			return u;
		}
	};
	
	public static RowMapper<TUser> detailMapper = new RowMapper<TUser>() {

		@Override
		public TUser mapRow(ResultSet rs, int rowNum) throws SQLException {
			TUser u = new TUser();
			u.setUid(rs.getInt("u_id"));
			u.setPassword(rs.getString("password"));
			u.setHead_img(rs.getString("head_img"));
			u.setLogin_time(rs.getTimestamp("login_time"));
			u.setNick_name(rs.getString("nick_name"));
			u.setPhone(rs.getString("phone"));
			u.setReg_channel(rs.getString("reg_channel"));
			u.setReg_time(rs.getTimestamp("reg_time"));
			u.setUser_id(rs.getString("user_id"));
			return u;
		}
	};
	
	public int getUid() {
		return uid;
	}
	public void setUid(int uid) {
		this.uid = uid;
	}
	public String getUser_id() {
		return user_id;
	}
	public void setUser_id(String user_id) {
		this.user_id = user_id;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getNick_name() {
		return nick_name;
	}
	public void setNick_name(String nick_name) {
		this.nick_name = nick_name;
	}
	public String getHead_img() {
		return head_img;
	}
	public void setHead_img(String head_img) {
		this.head_img = head_img;
	}
	public String getReg_channel() {
		return reg_channel;
	}
	public void setReg_channel(String reg_channel) {
		this.reg_channel = reg_channel;
	}
	public Date getReg_time() {
		return reg_time;
	}
	public void setReg_time(Date reg_time) {
		this.reg_time = reg_time;
	}
	public Date getLogin_time() {
		return login_time;
	}
	public void setLogin_time(Date login_time) {
		this.login_time = login_time;
	}
	
	
}
